package com.tx.server.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;

/**
 * @Description: 描述
 * @Author：XiaoBing
 * @Date：2020/12/4 16:38
 * @Version：1.0
 */
@Configuration
public class AccessTokenConfig {
    //@Bean
    //TokenStore tokenStore() {
    //    return new InMemoryTokenStore();
    //}

    @Autowired
    RedisConnectionFactory redisConnectionFactory;

    @Bean
    public TokenStore tokenStore() {
        return new RedisTokenStore(redisConnectionFactory);
    }
}
